package com.itheima.sh.homeWork01;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class IoTest {
    public static void main(String[] args) {
        try ( //创建字节输入流对象
              FileInputStream fis=new FileInputStream("D:/ITheima/img1/meinv.jpeg");
              //创建字节输出流对象
              FileOutputStream fos=new FileOutputStream("D:/ITheima/img2/meinv.jpeg");){
            //读写文件
            byte[]bytes=new byte[1024];
            int len;
            while ((len=fis.read(bytes))!=-1){
                fos.write(bytes,0,len);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
